import { EItemUpdateType } from "../../../Message/Game/EItemUpdateType";
import { JSON } from "../../../com/mui/serialization/json/JSON";
import { ItemConfig } from "./ItemConfig";
import { TEquipMelt } from "../../../Message/Db/Tables/TEquipMelt";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TJewelEmbedPos } from "../../../Message/Db/Tables/TJewelEmbedPos";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { ItemData } from "./info/ItemData";
import { EColor } from "../../../Message/Public/EColor";
import { TEquipAdvanceConfig } from "../../../Message/Db/Tables/TEquipAdvanceConfig";
import { TEquipAdvanceMap } from "../../../Message/Db/Tables/TEquipAdvanceMap";
import { EquipRefreshInfo } from "./info/EquipRefreshInfo";
import { TEquipUpdate } from "../../../Message/Db/Tables/TEquipUpdate";
import { TEquipPrefixUpgrade } from "../../../Message/Db/Tables/TEquipPrefixUpgrade";
import { TStrengthenShift } from "../../../Message/Db/Tables/TStrengthenShift";
import { TPetEquipAdvance } from "../../../Message/Db/Tables/TPetEquipAdvance";
import { ItemsUtil } from "../view/shortcuts/item/ItemsUtil";
import { ECategory } from "../../../Message/Public/ECategory";
import { EEquip } from "../../../Message/Public/EEquip";
import { _equipAdvanceMaterialDic_level } from "../../../this/_equipAdvanceMaterialDic_level";
type int = number;
//class EquipAdvanceConfig
    
    export  class EquipAdvanceConfig
    {
        constructor()
        {
            
            this._equipAdvanceConfigMap_level = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipAdvanceConfigMap_color = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipAdvanceMap_level = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipAdvanceMap_color = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipAdvanceMaterialDic_level = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipAdvanceMaterialDic_color = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipRefreshConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipUpdateConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipStrenShiftConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipPrefixUpgradeConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipPrefixUpgradeConfig2 = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipMeltConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._petEquipAdvanceMap = new Map<any, any> /* flash.utils.Dictionary */();
            this._equipPrefixMaterialDic = new Map<any, any> /* flash.utils.Dictionary */();
            if (EquipAdvanceConfig._instance != null) 
            {
                throw new Error(" EquipAdvanceConfig 单例 ");
            }
            this.init();
            return;
        }

        public isAdvanceMaterial(arg1: int, arg2: int): Boolean
        {
            if (arg2 == EItemUpdateType._EItemUpdateUpgrade) 
            {
                return !(this._equipAdvanceMaterialDic_level[arg1] == null);
            }
            if (arg2 == EItemUpdateType._EItemUpdateColor) 
            {
                return !(this._equipAdvanceMaterialDic_color[arg1] == null);
            }
            return false;
        }

        public getStrengthenCost(arg1: int): int
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=this._equipUpdateConfig;
            for(loc2 of loc4) 
            {
                if (loc2.operation != "EquipStrengthen") 
                {
                    continue;
                }
                loc1 = JSON.deserialize(loc2.condition);
                if (loc1["target"] != arg1) 
                {
                    continue;
                }
                return loc1["cost"];
            }
            return 0;
        }

        public getPetEquipTransformCost(): int
        {
            var loc2=null;
            var loc3=null;
            var loc1=ItemConfig.instance.getItemUpdateArrayByOperation("PetEquipTransform");
            var loc4=0;
            var loc5=loc1;
            for(loc3 of loc5) 
            {
                loc2 = JSON.deserialize(loc3.condition);
                return loc2["cost"];
            }
            return 0;
        }

        public getPetEquipTransMatsAmount(): int
        {
            var loc2=null;
            var loc3=null;
            var loc1=ItemConfig.instance.getItemUpdateArrayByOperation("PetEquipTransform");
            var loc4=0;
            var loc5=loc1;
            for(loc3 of loc5) 
            {
                loc2 = JSON.deserialize(loc3.condition);
                return loc2["amount"];
            }
            return 1;
        }

        public isEquipMeltSuit(arg1: int): Boolean
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._equipMeltConfig;
            for(loc1 of loc3) 
            {
                if (!(loc1.suitOne == arg1 || loc1.suitTwo == arg1)) 
                {
                    continue;
                }
                return true;
            }
            return false;
        }

        public getEquipMeltInfo(arg1: int, arg2: int): TEquipMelt
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._equipMeltConfig;
            for(loc1 of loc3) 
            {
                if (!(loc1.suitOne == arg1 && loc1.suitTwo == arg2 || loc1.suitOne == arg2 && loc1.suitTwo == arg1)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public init(): void
        {
            var loc1=null;
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_advance_config.json");
            this.writeConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_advance_map.json");
            this.writeMap(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_refresh.json");
            this.writeRefreshConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_update.json");
            this.writeEquipUpdateConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_prefix_upgrade.json");
            this.writePrefigUpgradeConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_strengthen_shift.json");
            this.writeStrenShiftConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_equip_melt.json");
            this.writeEquipMeltConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_pet_equip_advance.json");
            this.writePetEquipAdvanceConfig(loc1);
            return;
        }

        public getJewelAdvanceCost(arg1: int): int
        {
            if (!this._jewelAdvanceCostDic) 
            {
                this.readJewelAddvanceCostConfig();
            }
            return this._jewelAdvanceCostDic[arg1];
        }

        /* internal  */readJewelAddvanceCostConfig(): void
        {
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=null;
            this._jewelAdvanceCostDic = new Map<any, any> /* flash.utils.Dictionary */();
            var loc1=ConfigManager.instance.getJSONByFileName("t_item_update.json");
            var loc2="";
            var loc7=0;
            var loc8=loc1;
            for(loc3 of loc8) 
            {
                if (loc3.operation != "JewelAdvanceCost") 
                {
                    continue;
                }
                loc2 = loc3.condition;
                break;
            }
            loc4 = loc2.split("#");
            loc7 = 0;
            loc8 = loc4;
            for(loc6 of loc8) 
            {
                if ((loc5 = loc6.split(",")).length != 2) 
                {
                    continue;
                }
                this._jewelAdvanceCostDic[loc5[0]] = loc5[1];
            }
            return;
        }

        public getJewelComposeCost(): int
        {
            var loc1=JSON.deserialize(ItemConfig.instance.getUpdateInfo(ItemConfig.ComposeJewel, 1)["condition"]);
            return loc1.cost;
        }

        /* internal  */get specialJewelPosMap(): Map<any, any> /* flash.utils.Dictionary */
        {
            if (!this._specialJewelPosMap) 
            {
                this.readSpecialJewelMap();
            }
            return this._specialJewelPosMap;
        }

        /* internal  */readSpecialJewelMap(): void
        {
            var loc2=null;
            var loc3=null;
            this._specialJewelPosMap = new Map<any, any> /* flash.utils.Dictionary */();
            var loc1=ConfigManager.instance.getJSONByFileName("t_jewel_embed_pos.json");
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                loc3 = new TJewelEmbedPos();
                loc3.category = loc2.category;
                loc3.pos = loc2.pos;
                loc3.types = StringHelper.getString(loc2.types);
                loc3.types6 = StringHelper.getString(loc2.types6);
                loc3.desc1 = StringHelper.getString(loc2.desc1);
                loc3.desc2 = StringHelper.getString(loc2.desc2);
                loc3.desc3 = StringHelper.getString(loc2.desc3);
                this._specialJewelPosMap[loc3.category + "_" + loc3.pos] = loc3;
            }
            return;
        }

        public getJewelEmbedPosInfo(arg1: int, arg2: int): TJewelEmbedPos
        {
            return this.specialJewelPosMap[arg1 + "_" + arg2];
        }

        public checkJewelEmbed(arg1: ItemData, arg2: int, arg3: int): Boolean
        {
            var loc2=false;
            var loc3=false;
            var loc4=null;
            var loc5=null;
            var loc1;
            if (loc1 = this.getJewelEmbedPosInfo(arg1.category, arg1.type)) 
            {
                if ((loc4 = loc1.types.split("#")).indexOf(arg2.toString()) != -1) 
                {
                    loc2 = true;
                }
                if (!((loc5 = loc1.types6.split("#")).indexOf(arg2.toString()) == -1) && arg1.color == EColor._EColorRedGold) 
                {
                    loc3 = true;
                }
                if (arg3 == 0) 
                {
                    return loc2 || loc3;
                }
                if (arg3 <= 5) 
                {
                    return loc2;
                }
                if (arg3 == 6) 
                {
                    return loc3;
                }
            }
            return false;
        }

        /* internal  */writeConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TEquipAdvanceConfig();
                loc1.id = loc2.id;
                loc1.cost = loc2.cost;
                loc1.equipType = loc2.equipType;
                loc1.normalMaterialItemCode = loc2.normalMaterialItemCode;
                loc1.normalMaterialNum = loc2.normalMaterialNum;
                loc1.rate = loc2.rate;
                loc1.specialMaterialItemCode = loc2.specialMaterialItemCode;
                loc1.specialMaterialNum = loc2.specialMaterialNum;
                loc1.advanceDirection = loc2.advanceDirection;
                loc1.oldLevelSection = loc2.oldLevelSection;
                loc1.oldColor = loc2.oldColor;
                loc1.newLevelSection = loc2.newLevelSection;
                loc1.newColor = loc2.newColor;
                loc1.extendMaterialItemCode = loc2.extendMaterialItemCode;
                loc1.extendMaterialNum = loc2.extendMaterialNum;
                loc1.extendMaterialItemCode1 = loc2.extendMaterialItemCode1;
                loc1.extendMaterialNum1 = loc2.extendMaterialNum1;
                loc1.extendMaterialItemCode2 = loc2.extendMaterialItemCode2;
                loc1.extendMaterialNum2 = loc2.extendMaterialNum2;
                loc1.extendMaterialItemCode3 = loc2.extendMaterialItemCode3;
                loc1.extendMaterialNum3 = loc2.extendMaterialNum3;
                loc1.lossRateStrengthen = loc2.lossRateStrengthen;
                loc1.lossRatePrefix = loc2.lossRatePrefix;
                loc1.protectPropItemCode = loc2.protectPropItemCode;
                if (loc1.advanceDirection == EItemUpdateType._EItemUpdateUpgrade) 
                {
                    this._equipAdvanceConfigMap_level[loc1.equipType + "_" + loc1.oldLevelSection + "_" + loc1.oldColor] = loc1;
                    this.addToMaterialDic(loc1, EItemUpdateType._EItemUpdateUpgrade);
                    continue;
                }
                if (loc1.advanceDirection != EItemUpdateType._EItemUpdateColor) 
                {
                    continue;
                }
                this._equipAdvanceConfigMap_color[loc1.equipType + "_" + loc1.oldLevelSection + "_" + loc1.oldColor] = loc1;
                this.addToMaterialDic(loc1, EItemUpdateType._EItemUpdateColor);
            }
            return;
        }

        /* internal  */addToMaterialDic(arg1: TEquipAdvanceConfig, arg2: int): void
        {
            var loc2=null;
            var loc1=arg2 != EItemUpdateType._EItemUpdateUpgrade ? this._equipAdvanceMaterialDic_color : _equipAdvanceMaterialDic_level;
            if (!(arg1.specialMaterialItemCode == 0) && !loc1[arg1.specialMaterialItemCode]) 
            {
                loc2 = new ItemData(arg1.specialMaterialItemCode);
                loc1[arg1.specialMaterialItemCode] = loc2;
                if (!(loc2.itemInfo.item.codeUnbind == 0) && !loc1[loc2.itemInfo.item.codeUnbind]) 
                {
                    loc1[loc2.itemInfo.item.codeUnbind] = new ItemData(loc2.itemInfo.item.codeUnbind);
                }
            }
            if (!(arg1.normalMaterialItemCode == 0) && !loc1[arg1.normalMaterialItemCode]) 
            {
                loc2 = new ItemData(arg1.normalMaterialItemCode);
                loc1[arg1.normalMaterialItemCode] = loc2;
                if (!(loc2.itemInfo.item.codeUnbind == 0) && !loc1[loc2.itemInfo.item.codeUnbind]) 
                {
                    loc1[loc2.itemInfo.item.codeUnbind] = new ItemData(loc2.itemInfo.item.codeUnbind);
                }
            }
            if (!(arg1.extendMaterialItemCode == 0) && !loc1[arg1.extendMaterialItemCode]) 
            {
                loc2 = new ItemData(arg1.extendMaterialItemCode);
                loc1[arg1.extendMaterialItemCode] = loc2;
                if (!(loc2.itemInfo.item.codeUnbind == 0) && !loc1[loc2.itemInfo.item.codeUnbind]) 
                {
                    loc1[loc2.itemInfo.item.codeUnbind] = new ItemData(loc2.itemInfo.item.codeUnbind);
                }
            }
            return;
        }

        /* internal  */writeMap(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TEquipAdvanceMap();
                loc2.oldItemCode = loc1.oldItemCode;
                loc2.newItemCodeLevel = loc1.newItemCodeLevel;
                loc2.newItemCodeColor = loc1.newItemCodeColor;
                if (loc2.newItemCodeLevel != 0) 
                {
                    this._equipAdvanceMap_level[loc2.oldItemCode] = loc2;
                }
                if (loc2.newItemCodeColor == 0) 
                {
                    continue;
                }
                this._equipAdvanceMap_color[loc2.oldItemCode] = loc2;
            }
            return;
        }

        /* internal  */writeRefreshConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new EquipRefreshInfo();
                loc2.color = loc1.color;
                loc2.condition = StringHelper.getString(loc1.condition);
                loc2.cost = loc1.cost;
                loc2.id = loc1.id;
                loc2.operation = StringHelper.getString(loc1.operation);
                loc2.unit = loc1.unit;
                this._equipRefreshConfig[loc2.operation + "-" + loc2.color] = loc2;
            }
            return;
        }

        /* internal  */writeEquipUpdateConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TEquipUpdate();
                loc2.id = loc1.id;
                loc2.condition = loc1.condition;
                loc2.operation = loc1.operation;
                loc2.rate = loc1.rate;
                this._equipUpdateConfig[loc2.id] = loc2;
            }
            return;
        }

        /* internal  */writePrefigUpgradeConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TEquipPrefixUpgrade();
                loc2.id = loc1.id;
                loc2.amount = loc1.amount;
                loc2.cost = loc1.cost;
                loc2.levelLower = loc1.levelLower;
                loc2.levelUpper = loc1.levelUpper;
                loc2.materialEffect = loc1.materialEffect;
                loc2.prefix = loc1.prefix;
                loc2.type = loc1.type;
                loc2.materialHolySpecialItemCode = loc1.materialHolySpecialItemCode;
                loc2.materialHolySpecialAmount = loc1.materialHolySpecialAmount;
                this._equipPrefixUpgradeConfig[loc2.id] = loc2;
                this._equipPrefixUpgradeConfig2[loc2.type + "_" + loc2.prefix] = loc2;
                this.addToPrefixMaterialDic(loc2);
            }
            return;
        }

        public static get instance(): EquipAdvanceConfig
        {
            if (!EquipAdvanceConfig._instance) 
            {
                EquipAdvanceConfig._instance = new EquipAdvanceConfig();
            }
            return EquipAdvanceConfig._instance;
        }

        /* internal  */addToPrefixMaterialDic(arg1: TEquipPrefixUpgrade): void
        {
            var loc1=null;
            if (!(arg1.materialHolySpecialItemCode == 0) && !this._equipPrefixMaterialDic[arg1.materialHolySpecialItemCode]) 
            {
                loc1 = ItemConfig.instance.getInfoByCode(arg1.materialHolySpecialItemCode);
                this._equipPrefixMaterialDic[arg1.materialHolySpecialItemCode] = loc1;
                if (!(loc1.item.codeUnbind == 0) && !this._equipPrefixMaterialDic[loc1.item.codeUnbind]) 
                {
                    this._equipPrefixMaterialDic[loc1.item.codeUnbind] = new ItemData(loc1.item.codeUnbind);
                }
            }
            return;
        }

        public isEquipPrefixUpgratMaterial(arg1: int): Boolean
        {
            return !(this._equipPrefixMaterialDic[arg1] == null);
        }

        /* internal  */writeStrenShiftConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TStrengthenShift();
                loc2.level = loc1.level;
                loc2.cost = loc1.cost;
                loc2.changeRate = loc1.changeRate;
                this._equipStrenShiftConfig[loc2.level] = loc2;
            }
            return;
        }

        /* internal  */writeEquipMeltConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TEquipMelt();
                loc2.id = loc1.id;
                loc2.cost = loc1.cost;
                loc2.propNum = loc1.propNum;
                loc2.suitOne = loc1.suitOne;
                loc2.suitTarget = loc1.suitTarget;
                loc2.suitTwo = loc1.suitTwo;
                this._equipMeltConfig[loc2.id] = loc2;
            }
            return;
        }

        /* internal  */writePetEquipAdvanceConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc1 of loc4) 
            {
                loc2 = new TPetEquipAdvance();
                loc2.oldItemCode = loc1.oldItemCode;
                loc2.newItemCode = loc1.newItemCode;
                loc2.materialCode = loc1.materialCode;
                loc2.materialNum = loc1.materialNum;
                loc2.money = loc1.money;
                loc2.successRate = loc1.successRate;
                this._petEquipAdvanceMap[loc2.oldItemCode] = loc2;
            }
            return;
        }

        public getAdvancedEquipCode(arg1: int): TEquipAdvanceMap
        {
            return this._equipAdvanceMap_level[arg1];
        }

        public getAdvancedColorEquipCode(arg1: int): TEquipAdvanceMap
        {
            return this._equipAdvanceMap_color[arg1];
        }

        public getAdvanceConfig(arg1: ItemData): TEquipAdvanceConfig
        {
            var loc2=0;
            var loc1=arg1.itemInfo.item.level;
            if (loc1 > 10 && loc1 < 85 && !ItemsUtil.isHeartLock(arg1)) 
            {
                loc1 = Math.floor(loc1 / 10) * 10;
            }
            if (arg1.category != ECategory._ECategoryMount) 
            {
                loc2 = arg1.type;
            }
            else 
            {
                loc2 = -1;
            }
            return this._equipAdvanceConfigMap_level[loc2 + "_" + loc1 + "_" + arg1.color];
        }

        public EquipAdvanceConfig.get equipAdvanceConfigMap_level(): Map<any, any> /* flash.utils.Dictionary */
        {
            return this._equipAdvanceConfigMap_level;
        }

        public getAdvanceColorConfig(arg1: ItemData): TEquipAdvanceConfig
        {
            var loc2=0;
            var loc1=arg1.itemInfo.item.level;
            if (loc1 > 10 && loc1 < 85) 
            {
                loc1 = Math.floor(loc1 / 10) * 10;
            }
            if (arg1.category != ECategory._ECategoryMount) 
            {
                loc2 = arg1.type;
            }
            else 
            {
                loc2 = -1;
            }
            return this._equipAdvanceConfigMap_color[loc2 + "_" + loc1 + "_" + arg1.color];
        }

        public getPetEquipAdvanceConfig(arg1: int): TPetEquipAdvance
        {
            return this._petEquipAdvanceMap[arg1];
        }

        public getRefreshConfigInfo(arg1: int): EquipRefreshInfo
        {
            return this._equipRefreshConfig["refresh-" + arg1];
        }

        public getDecomposeConfigInfo(arg1: int): EquipRefreshInfo
        {
            return this._equipRefreshConfig["decompose-" + arg1];
        }

        public getComposeConfigInfo(arg1: int): EquipRefreshInfo
        {
            return this._equipRefreshConfig["compose-" + arg1];
        }

        public getTimesByStar(arg1: int): int
        {
            var loc3=null;
            var loc4=null;
            var loc1=this._equipRefreshConfig["starIncome-0"];
            var loc2=loc1.condition.split("#");
            var loc5=0;
            while (loc5 < loc2.length) 
            {
                loc4 = (loc3 = loc2[loc5] as string).split(",");
                if (int(loc4[0]) == arg1) 
                {
                    return int(loc4[1]);
                }
                ++loc5;
            }
            return 0;
        }

        public getTotalStrengthen(): int
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=0;
            var loc5=0;
            if (this._totleStrengthen != 0) 
            {
                return this._totleStrengthen;
            }
            var loc6=0;
            var loc7=this._equipUpdateConfig;
            for(loc1 of loc7) 
            {
                if (loc1.operation != "EquipStrengthen") 
                {
                    continue;
                }
                loc3 = 0;
                loc2 = loc1.rate.split("#");
                loc5 = 0;
                while (loc5 < loc2.length) 
                {
                    loc4 = parseInt((loc2[loc5] as string).split(",")[0]);
                    loc3 = Math.max(loc3, loc4);
                    ++loc5;
                }
                this._totleStrengthen = this._totleStrengthen + loc3;
            }
            return this._totleStrengthen;
        }

        public getTotalPetStrengthen(): int
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=0;
            var loc5=0;
            if (this._totlePetStrengthen != 0) 
            {
                return this._totlePetStrengthen;
            }
            var loc6=0;
            var loc7=this._equipUpdateConfig;
            for(loc1 of loc7) 
            {
                if (loc1.operation != "PetEquipStrengthen") 
                {
                    continue;
                }
                loc3 = 0;
                loc2 = loc1.rate.split("#");
                loc5 = 0;
                while (loc5 < loc2.length) 
                {
                    loc4 = parseInt((loc2[loc5] as string).split(",")[0]);
                    loc3 = Math.max(loc3, loc4);
                    ++loc5;
                }
                this._totlePetStrengthen = this._totlePetStrengthen + loc3;
            }
            return this._totlePetStrengthen;
        }

        public getStrenShiftCost(arg1: int): int
        {
            return this._equipStrenShiftConfig[arg1] ? this._equipStrenShiftConfig[arg1]["cost"] : 0;
        }

        public getPrefixUpgradeInfo(arg1: int, arg2: int, arg3: int): TEquipPrefixUpgrade
        {
            var loc1=null;
            if (!(arg1 == EEquip._EEquipFashion) && !(arg1 == EEquip._EEquipFashionWeapon) && !(arg1 == EEquip._EEquipWing) && !(arg1 == EEquip._EEquipHeartLock) && !(arg1 == EEquip._EEquipFootPrint) && !(arg1 == EEquip._EEquipBubble) && !(arg1 == EEquip._EEquipSurround) && !(arg1 == EEquip._EEquipWaistBelt) && !(arg1 == EEquip._EEquipElf)) 
            {
                arg1 = -1;
            }
            var loc2=0;
            var loc3=this._equipPrefixUpgradeConfig;
            for(loc1 of loc3) 
            {
                if (!(arg2 >= loc1.levelLower && arg2 <= loc1.levelUpper && arg3 == loc1.prefix && arg1 == loc1.type)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getPrefixUpgradeInfoByParams(arg1: int, arg2: int): TEquipPrefixUpgrade
        {
            return this._equipPrefixUpgradeConfig2[arg1 + "_" + arg2];
        }

        /* internal */ /* var */_equipAdvanceConfigMap_level: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipAdvanceConfigMap_color: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipAdvanceMap_level: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipAdvanceMap_color: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipAdvanceMaterialDic_level: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipAdvanceMaterialDic_color: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipUpdateConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipStrenShiftConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipPrefixUpgradeConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipPrefixUpgradeConfig2: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipMeltConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_petEquipAdvanceMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipRefreshConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_equipPrefixMaterialDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_totlePetStrengthen: int=0;

        /* internal */ /* var */_jewelAdvanceCostDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_specialJewelPosMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: EquipAdvanceConfig;

        /* internal */ /* var */_totleStrengthen: int=0;
    }
